// 基于template/src/views/{{appModules}}/{{pages@DEEDITVIEW}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	EditViewActionType,
	EditViewController,
	IEditViewAbility,
	IEditViewControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useEditViewProps,
	useEditViewBasic,
	useEditViewControllerParams,
    useEditViewAction,
} from '@/hooks/view/use-edit-view';
import { model } from "./avue-child-one-edit-view-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useEditViewProps()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useEditViewBasic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useEditViewAction(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<EditViewActionType, IEditViewAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<EditViewActionType, IEditViewAbility>>
) {
	const params: IEditViewControllerParams<
		EditViewActionType,
		IEditViewAbility
	> = useEditViewControllerParams(model, props, evt);
	return new EditViewController(params);
}